package com.wangp.designpattern.singleton;

/**
 * 单例模式----懒汉式.
 *
 * @author WangPing2
 * <p>createDate 2024-12-03</p>
 **/
public class LazySingletonModel {

    //1.私有的构造方法
    private LazySingletonModel(){

    }
    //属性
    private static  LazySingletonModel instance=null;

    public static LazySingletonModel getInstance(){
        if(instance==null){
            instance=new LazySingletonModel();
        }
        return   instance;
    }
}
